package com.lantosec.hmrp.modules.eval.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.eval.vo.EvalDetailedVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 考评明细 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-30
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EvalDetailed extends BaseEntity<EvalDetailedVO> {

    private static final long serialVersionUID = 1L;
    public EvalDetailed(EvalDetailedVO vo){
        this.evalDetailedId = vo.getEvalDetailedId();
        this.evalTaskId = vo.getEvalTaskId();
        this.planTargetId = vo.getPlanTargetId();
        this.executorUserId = vo.getExecutorUserId();
        this.executorUser = vo.getExecutorUser();
        this.executorTime = vo.getExecutorTime();
        this.taskState = vo.getTaskState();
        this.submitTime = vo.getSubmitTime();
        this.currExecNum = vo.getCurrExecNum();
        this.planTotalScore = vo.getPlanTotalScore();
        this.planScore = vo.getPlanScore();
        this.planMoney = vo.getPlanMoney();
        this.evalStartPhoto = vo.getEvalStartPhoto();
        this.executorSignature = vo.getExecutorSignature();
        this.targetSignature = vo.getTargetSignature();
        this.evalSummary = vo.getEvalSummary();
    }

    @Override
    public EvalDetailedVO convertToVO(){
        return new EvalDetailedVO(this);
    }


    /**
     * 考评任务明细ID
     */
    @TableId(value = "eval_detailed_id", type = IdType.AUTO)
    private Integer evalDetailedId;

    /**
     * 考评计划ID
     */
    private Integer evalTaskId;

    /**
     * 考评对象ID
     */
    private Integer planTargetId;

    /**
     * 执行者用户ID
     */
    private String executorUserId;

    /**
     * 执行者
     */
    private String executorUser;

    /**
     * 执行时间
     */
    private Date executorTime;

    /**
     * 任务状态(0:初始化 1:保存 2:提交)
     */
    private Integer taskState;

    /**
     * 提交时间
     */
    private Date submitTime;

    /**
     * 当前周期内执行计数
     */
    private Integer currExecNum;

    /**
     * 考评任务总分
     */
    private BigDecimal planTotalScore;

    /**
     * 考评任务得分
     */
    private BigDecimal planScore;

    /**
     * 奖惩总金额
     */
    private BigDecimal planMoney;

    /**
     * 考评开始图片(upload表ID)
     */
    private String evalStartPhoto;

    /**
     * 执行者签名
     */
    private String executorSignature;

    /**
     * 考评对象签名
     */
    private String targetSignature;

    /**
     * 考评总结
     */
    private String evalSummary;


    public enum ColName {
        eval_detailed_id, eval_task_id, plan_target_id, executor_user_id, executor_user, executor_time, task_state, submit_time, curr_exec_num, plan_total_score, plan_score, plan_money, eval_start_photo, executor_signature, target_signature, eval_summary, 
    }
}
